package org.example.wx.client;

import java.lang.reflect.Proxy;


public class ProxyClient {

    private Class serviceInterface;


    //根据接口的class获取接口相应的代理对象。
    Object getClient(Class serviceInterface) {
        return Proxy.newProxyInstance(serviceInterface.getClassLoader(), new Class[]{serviceInterface}, new ProxyClientHandler(serviceInterface));
    }

}
